<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body></body>
  <script>
    class obj {
      //构造函数
      constructor(day, sum) {
        this.day = day;
        this.sum = sum;
      }
      //原型的方法
      tday() {
        console.log(this.day);
      }
      sum() {
        console.log(this.sum);
      }
    }

    var tree = new obj("11", "22");

    tree.tday();
    tree.sum();
  </script>
</html>
